<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>feasibleSet</title>
<style type="text/css">
	body {background-color: white; color: black; font-family:sans-serif; font-size:medium;}
	a:link {color: #3300ff;}
	a:visited {color: #663399;}
	a:hover {color:#0099ff;}
	a:active {color: #0066cc;}
	a.button {text-decoration:none;}
	
	table.nav  {background-color: #dbddff;}
	table.body {margin-top:2ex; margin-bottom:2ex;}
	table.programlistingindent {margin-left:32px;}
	
	img { margin-bottom:0px; margin-top:0px;}
	tt {margin-left:0.5em; margin-right:0.5em; font-weight:lighter;}
	
	p {margin-top:0ex;}
	p.synopsis {margin-left:32px;}
	p.programlistingindent {margin-left:32px;}
	p.citetitle {margin-left:2em;}
	
	ul ul {list-style-type:square;}
	ul li p {margin-top:0ex; margin-bottom:.5ex; padding:0}
	ol li p {margin-top:0ex; margin-bottom:.5ex; padding:0}
	
	h1.reftitle {color:#a90000;}
	h1.reftitle {font-size:3.7ex; margin-top:0; margin-bottom:0; font-weight:bold}
	h1.title {color:black; font-size:4ex; margin-top:1ex; font-weight:bold}
	h2.title {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:3ex}
	h3.title {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:2.5ex}
	h4.title {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:2ex}
	h2 {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:2.5ex}
	h3 {color:#bd0000; margin-top:1ex; margin-bottom:.9ex; font-weight:bold; font-size:2ex} 
	
	pre.programlisting {margin-left:32px;}
	pre.synopsis {margin-left:32px;}
	
	
	.categorytitle {margin-top:8px; padding-top:0px;}
	.categorylist {background-color: #e1e6f2;}
 	</style>
</head>
<body>
<a name="top_of_page"></a><p style="font-size:1px;"></p>
<h1 class="reftitle">feasibleSet</h1>
<h2>Purpose</h2>
<p>Computes the feasible set of a given parametric problem.</p>
<h2>Syntax</h2>
<pre class="synopsis">K = prob.feasibleSet()</pre>
<pre class="synopsis">K = prob.feasibleSet('method')</pre>
<pre class="synopsis">K = prob.feasibleSet(regions)</pre>
<h2>Description</h2>
<p></p>
        Method for computing a feasible set of a given parametric problem. For the 
        following formulation of a parametric problem
             <p class="programlistingindent"><img src="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset4.png" alt="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset4.png"></p>              
             the feasible set <tt>K</tt> is the polyhedron
             <p class="programlistingindent"><img src="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset5.png" alt="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset5.png"></p>
             
             This method implements two procedures to compute <tt>K</tt>:
             <ol>
                 
         <li> if <tt>K=prob.feasibleSet('method')</tt> is called, the feasible set is
                     calculated by a given 'method' used in projection (can be expensive)
                 </li>
                 
         <li> if <tt>K=prob.feasibleSet(regions)</tt> is called with "regions"
                     being the critical regions of the parametric solution,
                     then K is constructed as follows.
                     For each facet of each region do:
                     <ol>
                         
               <li> compute the center of the facet </li>
                         
               <li> take a small step accross the facet </li>
                         
               <li> solve the problem for the new point </li>
                         
               <li> if the problem is infeasible, add the facet to
                         the feasible set </li>
                     
            </ol>
                 
         </li>
             
      </ol>
    
     
   <h2>Input Arguments</h2>
<table cellspacing="0" class="body" cellpadding="4" border="0" width="100%">
<colgroup>
<col width="31%">
<col width="69%">
</colgroup>
<tbody>
<tr valign="top">
<td><tt>method</tt></td>
<td>
<p></p>A string describing which method of projection to use for computing the feasible set. For more help of the
            methods type <tt>help Polyhedron/projection</tt>.    
        <p>
	    		Class: <tt>char</tt></p>
</td>
</tr>
<tr valign="top">
<td><tt>regions</tt></td>
<td>
<p></p>A polyhedron array for which to describe the feasible set. The polyhedra must be in the same dimension.<p>
	    		Class: <tt>Polyhedron</tt></p>
</td>
</tr>
</tbody>
</table>
<h2>Output Arguments</h2>
<table cellspacing="0" class="body" cellpadding="4" border="0" width="100%">
<colgroup>
<col width="31%">
<col width="69%">
</colgroup>
<tbody><tr valign="top">
<td><tt>K</tt></td>
<td>
<p></p> The computed feasible set for the given parametric optimization problem.            
        <p>
	    		Class: <tt>Polyhedron</tt></p>
</td>
</tr></tbody>
</table>
<h2>Example(s)</h2>
<h3>Example 
				1</h3> Create parametric LP with 3 decision variables and 2 parameters  The cost function <img src="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset1.png" alt="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset1.png"> 
      <pre class="programlisting"> f = [1; -1; 0.5]; pF = [1 -1.2; -0.8 -2.1; 3.1 0]; </pre>
<pre class="programlisting"></pre> The linear inequality constraints <img src="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset2.png" alt="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset2.png">
      <pre class="programlisting"> A = [-11.15 -16.28 -8.09; 6.85 16.17 11.61; 10.37 2.64  5.92; 18.22 -11.28 2.42; -5.29 -5.6 2.4];</pre>
<pre class="programlisting"></pre>
<pre class="programlisting"> b = [ 1.43; 3.49; 3.98; 2.2; 2.23]; </pre>
<pre class="programlisting"></pre>
<pre class="programlisting"> B = [ -0.11 0.5; -0.89 -0.83; 0.74 0.2; 1.39 -1.01; 2.47 -0.62]; </pre>
<pre class="programlisting"></pre> Provide bounds on the parameters <img src="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset3.png" alt="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset3.png"> 
      <pre class="programlisting"> Ath = [eye(2); -eye(2)]; bth = [2;2;5;5]; </pre>
<pre class="programlisting"></pre> Create the parametric optimization problem <pre class="programlisting"> problem = Opt('f',f,'A',A,'b',b,'pB',B,'pF',pF,'Ath',Ath,'bth',bth) </pre>
<pre class="programlisting">-------------------------------------------------
Parametric linear program
	Num variables:                3
	Num inequality constraints:   5
	Num equality constraints:     0
	Num parameters:               2
	Solver:                     PLCP
-------------------------------------------------
</pre> We want to compute the feasible set of the parametric optimization problem.<pre class="programlisting"> K = problem.feasibleSet() </pre>
<pre class="programlisting">Polyhedron in R^2 with representations:
    H-rep (redundant)   : Inequalities   4 | Equalities   0
    V-rep               : Unknown (call computeVRep() to compute)
Functions : none
</pre> The feasible set represents a region where there exist a feasible set of constraints.
             Now compute the solution by solving the parametric optimization problem: <pre class="programlisting"> res = problem.solve </pre>
<pre class="programlisting">mpt_plcp: 8 regions

res = 

        xopt: [1x1 PolyUnion]
    exitflag: 1
         how: 'ok'
       stats: [1x1 struct]

</pre> The parametric solver returns regions with the optimal solution to the 
        parametric optimization problem. The union of these regions is a subset of the 
            feasible set <tt>K</tt> because in some parts of the feasible space the cost 
            function can be unbounded and therefore the optimality conditions do not hold.
         On the figure below one can see that in this example the union of regions returned
        from the parametric solver is a subset of the feasible set <tt>K</tt>.<pre class="programlisting"> K.plot('wire',true,'linewidth',2,'linestyle','--');
            hold on;
            res.xopt.plot
        </pre>
<pre class="programlisting"></pre>
<p class="programlistingindent"><img src="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset_img_1.png" alt="../../../../../fig/mpt/modules/solvers/@Opt/feasibleset_img_1.png" width="60%"></p>
<h2>See Also</h2>
<a href="./opt.html">opt</a><p></p>
<table class="nav" summary="Navigation aid" border="0" width="100%" cellpadding="0" cellspacing="0"><tr valign="top">
<td align="left" width="20">
<a href="solve.html" class="button">&#9664;</a>  </td>
<td align="left">solve</td>
<td>  </td>
<td align="right">copy</td>
<td align="right" width="20"><a href="copy.html" class="button">&#9654;</a></td>
</tr></table>
<br><p>©  <b>2003-2013</b>     Michal Kvasnica: STU Bratislava,    <a href="mailto:michal.kvasnica@stuba.sk">michal.kvasnica@stuba.sk</a></p>
</body>
</html>
